#include <iostream>
#include <fstream>
#include <iterator>
#include <vector>
#include "HSLSolver.h"

#include "walksat/WalkSat.h"

int main(int argc, char* argv[]) {
    return walksat_main(argc, argv);
}

#if USE_MINISAT

#include "minisat/core/Dimacs.h"
#include "minisat/core/SolverTypes.h"


using Minisat::Lit;
using Minisat::Var;
using Minisat::vec;

int main(int argc, char* argv[]) {
    HSLSolver s;
    
    // setting cin to not ignore whitespace
    std::cin >> std::noskipws;
    std::istream_iterator<char> in;
    std::ifstream ifr(argv[1]);
    if (argc == 1) {
        in = std::istream_iterator<char>(std::cin); 
    } else {
        in = std::istream_iterator<char>(ifr);
    }
        if (in == std::istream_iterator<char>())
            printf("ERROR! Could not open file: %s\n", argc == 1 ? "<stdin>" : argv[1]), exit(1);

    Minisat::parse_DIMACS_main(in, s);
    s.hslSolve();
    return 0;
}

#endif
